package cn.snowheart.iterator.menu;

import cn.snowheart.iterator.iterator.ListIterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 煎饼店菜单
 *
 * @author liuwanxiang
 * @version 2019/07/09
 */
public class PizzaMenu implements Menu {

    private List<MenuItem> menus;

    public PizzaMenu() {
        menus = new ArrayList<>();

        add(new MenuItem("Pizza1", "New York", true, 3.99));
        add(new MenuItem("Pizza2", "Beijing", true, 5.99));
        add(new MenuItem("Pizza3", "Chicago", true, 2.99));
        add(new MenuItem("Pizza4", "Washington", true, 4.99));
    }

    @Override
    public Iterator<MenuItem> createIterator() {
        return new ListIterator<>(menus);
    }

    @Override
    public void add(MenuItem item) {
        menus.add(item);
    }
}
